from concurrent.futures import ThreadPoolExecutor
import time


def task(n):
    print(f"Processing {n}")
    time.sleep(2)
    return n * 2


# 创建一个包含3个工作线程的线程池
with ThreadPoolExecutor(max_workers=3) as executor:
    # 提交任务到线程池
    futures = [executor.submit(task, i) for i in range(5)]

    # 获取任务结果
    for future in futures:
        print(f"Result: {future.result()}")





    for root, dirs, files in os.walk(debug_path):
        for file in files:
            file_path = os.path.join(root, file)
            target = file.split('-')[-6]
            if target == "内容":
                with open(file_path, 'r', encoding='utf-8') as fi:
                    content = fi.read().split("------------------------------")[0]
                    xx = sendTextToXH(text=content, isXH=True)
                    print(xx)
                    print("***"*20)